#ifndef	__USER_IPC_ST_H__
#define	__USER_IPC_ST_H__

#include "fr_ui_node.h"

typedef enum
{
	DAILY_DATA,
	SYNC_DATA,
	INFO_DATA,
	
}ipc_data_type_t;

typedef		struct
{
	uint16_t	ucYear;
	uint8_t		ucMonth;
    uint8_t		ucDate;
	uint8_t		ucHour;
	uint8_t		ucMinute;
    uint8_t		ucSecond;
}time_rtc_t;

//battery
typedef enum
{
	BATTERY_GO,
	BATTERY_LOW,
	BATTERY_FULL,
	BATTERY_CHARGEIN,
	
}battery_state_t;

typedef struct
{
	uint8_t state;			//battery_state_t
	uint16_t battery_value;
}battery_t;

//weather
typedef enum
{
	WEATHER_SNOW,
	WEATHER_SUN,
	WEATHER_CLOUDY,

}weather_type_t;

typedef struct
{
	uint8_t type;			//weather_type_t
	int16_t cur_tempture;
	int16_t h_tempture;
	int16_t l_tempture;

}weather_t;

typedef enum
{
	UI_MAIN,
	UI_FLOAT_WIN_UP,
	UI_FLOAT_WIN_LEFT,
	UI_FLOAT_WIN_DOWN,
	UI_MENU,
	UI_MAX
}ui_mode_t;

typedef struct
{
	uint8_t ui_page_id;	
	uint16_t ui_page_cur_x;
	uint16_t ui_page_cur_y;
}ui_layer_t;

typedef enum
{
	PANEL_STATE_OFF,
	PANEL_STATE_ON,
	PANEL_STATE_MAX
}panel_state_t;


typedef struct
{
	uint8_t ui_mode;			//ui_mode_t
	uint8_t ui_page_id;			//mode 0 page id
	uint8_t ui_node_lv;
	//--------new
	uint8_t time_format;		// 0 : 24小时�?1:12小时�?
	uint8_t temperature_format;	//0 : 摄氏度，1：华氏摄氏度 
	uint8_t distance_format;	//0 : 公制�?：英�?

	//clock id
	uint8_t ui_clock_id;

	//ui default style
	uint8_t ui_default_style;

	//menu style
	uint8_t ui_menu_style_id;

	//language
	uint8_t ui_language;

	uint8_t ui_backlight_brightness;

	uint8_t ui_lock;

	uint8_t ui_reset;

	uint8_t ui_powerdown;	

	uint8_t ui_music_state;

	uint8_t ui_prev_mode;

	// 节点栈定义
	uint8_t ui_node_depth;
	lv_ui_node_t ui_node_stack[UI_NODE_MAX_DEPTH];

	//--------new
	uint8_t custom_page_mode[CUSTOM_ID_ARRY_NUMBER];
	
}ui_info_t;

typedef struct
{
	uint32_t   start_time;
	uint16_t   total_time;
	uint16_t 	speed;
	uint16_t   step;
	uint16_t   cal;
	uint16_t   dis;
	uint8_t    heart;
	uint8_t     max_heart;
	uint8_t     min_heart;
	uint8_t     sports_mode;
	uint8_t    sports_heart[72];// 72 
}_sport_t;

typedef struct
{
	_sport_t  data[5];
	uint8_t   index;
}_sport_data_t;


//===========================================================
typedef struct
{
	uint32_t sport_total_time;
	uint16_t total_carloie;
	uint8_t avg_hrm;

	//once
	uint8_t sport_type;
	uint32_t sport_time;
	uint16_t speed;
	uint16_t step;
	uint16_t distance;
	uint16_t carloie;
	uint8_t state;
	uint8_t hrm;
	uint8_t max_hrm;
	uint8_t min_hrm;
	uint8_t oxygen;

}sport_t;

typedef struct 
{
	uint8_t		isEn;
	uint8_t		Repeat;
	uint32_t 	alarm_time_value;
}Alarm_type;

typedef struct//����
{
	unsigned char  flag;//����
	unsigned char  hour;//ʱ
	unsigned char  minute;//��
	unsigned char  weekday;//����
	//unsigned char  data[50];//��������
}_clockTime;

typedef struct
{	

//system state

	//bt state
	uint8_t bt_state;
	uint8_t bt_on_off;

	//ble state
	uint8_t ble_state;

	uint8_t ble_on_off;

	//time 
	time_rtc_t time;

	//battery state
	battery_t battery;

	uint8_t panel_state;

//system info
	uint8_t version;
	//------new add
	//uint16_t version;
	uint8_t ble_address[6];

	//step message
	uint32_t step;
	uint32_t calorie;
	uint32_t distance;
	uint8_t motion;
	uint8_t cadence_step;
	uint16_t cadence_amp;	
	uint8_t cadence_degree;
	uint8_t sleep_active;

	//hearte message
	uint8_t bpm;
	uint8_t bpm_warning_h;
	uint8_t bpm_warning_l;

	//o2
	uint8_t sbp;
	uint8_t dbp;
	uint8_t spo2;

	//blood
	uint8_t blood_h;
	uint8_t blood_l;

//ui display
	ui_info_t ui_info;

	//weather message
	weather_t day1;
	weather_t day2;
	weather_t day3;
	weather_t day4;
	weather_t day5;
	weather_t day6;
	weather_t day7;

	//time tick
	uint32_t system_tick_value;

	////volume
	uint8_t bt_volume_media;
	uint8_t bt_volume_hfp;
	uint8_t bt_volume_tone;
	uint8_t dsp_version;
	//-----new add
	//uint16_t dsp_version;

	uint8_t	disturb_state;

	uint8_t	phone_book_sync_state;		//0 error,phone server off, 1 syncing, 2 finished
	uint16_t phone_book_id_offset;

	uint16_t sleep_total_time;
	uint16_t deep_sleep_time;
	uint16_t light_sleep_time;

	//cm3 tick counter
	uint32_t user_tick_counter;


	sport_t sport;

	uint16_t light_auto_close_time;

	uint8_t audio_mic_on;

	_clockTime	alarm[5];

	uint32_t timer_init_value;
	uint32_t count_down_counter;

	uint16_t m3_version_new;
	uint16_t dsp_version_new;
	//----new add
	uint32_t steptarget;
	uint8_t camera_state;
	uint8_t low_power_state;
	uint8_t count_down_counter_state;
	//----new
	uint8_t device_alarm_index;
	uint8_t watch_hrm_value;
	uint8_t remind_index;
	uint32_t stopwatch_time;
	uint16_t phone_book_len;	

	//lv_ui_node_t ui_node_stack[UI_NODE_MAX_DEPTH];
	//uint8_t ui_node_depth;   //当前列表的长度

}ipc_daily_data_t;

typedef struct
{
	ipc_data_type_t type;
	
	
}ipc_info_t;




#endif
